<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<title>Add a repo</title>
<link href="../../share/doc/manual.css" rel="stylesheet" type="text/css" />
  
</head>
<body>

<div id="container">
	<div id="main">
<br>
<h1>HOWTO add (or remove) a package database</h1>
<h2>Background</h2>
These are web pages that introduce the package system in Puppy 5.x:<br>
<br>
<big><a href="http://puppylinux.com/woof/ppm.htm">http://puppylinux.com/woof/ppm.htm</a></big> <br>
<big><a href="http://puppylinux.com/woof/pkg-db-format.htm">http://puppylinux.com/woof/pkg-db-format.htm</a></big> <br>
<br>
There are two local files that you need to know about:<br><a href="file:///root/.packages/DISTRO_PET_REPOS">/root/.packages/DISTRO_PET_REPOS</a><br>
<a href="file:///root/.packages/DISTRO_COMPAT_REPOS">/root/.packages/DISTRO_COMPAT_REPOS</a> <br>
<br>
<h2>DISTRO_COMPAT_REPOS</h2>
What you will see in this file are two variables named PKG_DOCS_DISTRO_COMPAT and REPOS_DISTRO_COMPAT.<br>
<h3>PKG_DOCS_DISTRO_COMPAT</h3>
This consists of a series of entries that are separated by a space-character. Here is an example of one entry:<br>
<pre>slackware.cs.utah.edu|http://slackware.cs.utah.edu/pub/slackware/slackware-${DISTRO_COMPAT_VERSION}/PACKAGES.TXT|Packages-slackware-${DISTRO_COMPAT_VERSION}-official</pre>
The variable DISTRO_COMPAT_VERSION is defined in this file:<br>
<br>
<a href="file:///etc/DISTRO_SPECS">/etc/DISTRO_SPECS</a><br>
<br>
An example would be Puppy built from Slackware version 12.2, so the above example resolves to:<br>
<pre>slackware.cs.utah.edu|http://slackware.cs.utah.edu/pub/slackware/slackware-12.2/PACKAGES.TXT|Packages-slackware-12.2-official</pre>

<br>
The entry has three fields, separated by a vertical-bar character:<br>
1st: This is the URL used for testing that the site is responding.<br>
2nd: The full URI of the repository packages database file.<br>
3rd: The name of the database file after it has been downloaded and converted to a standardised format.<br>
<br>
You must only add another repository which has packages of the same
"compatible distro" that was used to build Puppy, that is, one of
Slackware, Debian, Ubuntu or Arch. The DISTRO_BINARY_COMPAT variable in
/etc/DISTRO_SPECS defines this.<br>
<br>
So, when Puppy downloads the database file, in the above example
'PACKAGES.TXT', it must be in the database format used by the
compatible distro. Puppy will expect it to be in that format to be able
to convert it to the standadised format used in Puppy.<br>
<h3>REPOS_DISTRO_COMPAT</h3>
This variable has the same format, entries separated by
space-character, fields in each entry separated by the vertical-bar.
Here is an example:<br>
<pre>slackware.cs.utah.edu|http://slackware.cs.utah.edu/pub/slackware/slackware-${DISTRO_COMPAT_VERSION}|Packages-slackware-${DISTRO_COMPAT_VERSION}-official</pre>
...it looks like before, but in this case the full URI is to where the
actual packages are kept. Note that individual packages may be in
subdirectories but this information is in the package database.<br>
<br>
If the repository is mirrored, no problem, additional entries can be
made, all with the same 3rd field, for example here is the complete
definition of REPOS_DISTRO_COMPAT (it's a bit long, so I've put in
new-lines for each entry):<br>
<pre>slackware.cs.utah.edu|http://slackware.cs.utah.edu/pub/slackware/slackware-${DISTRO_COMPAT_VERSION}|Packages-slackware-${DISTRO_COMPAT_VERSION}-official <br>slackware.mirrors.tds.net|http://slackware.mirrors.tds.net/pub/slackware/slackware-${DISTRO_COMPAT_VERSION}|Packages-slackware-${DISTRO_COMPAT_VERSION}-official <br>ftp.gwdg.de|http://ftp.gwdg.de/pub/linux/slackware/slackware-${DISTRO_COMPAT_VERSION}|Packages-slackware-${DISTRO_COMPAT_VERSION}-official <br>ftp.isu.edu.tw|http://ftp.isu.edu.tw/pub/Linux/Slackware/slackware-${DISTRO_COMPAT_VERSION}|Packages-slackware-${DISTRO_COMPAT_VERSION}-official <br>repository.slacky.eu|http://repository.slacky.eu/slackware-${DISTRO_COMPAT_VERSION}|Packages-slackware-${DISTRO_COMPAT_VERSION}-slacky</pre>
On the other hand, one download site may have more than one
"repository". What I mean by that is best shown by example. This is the
REPOS_DISTRO_COMPAT variable for the Ubunt-compatible build of Puppy:<br>
<pre>ftp.filearena.net|http://ftp.filearena.net/pub/ubuntu|Packages-ubuntu-${DISTRO_COMPAT_VERSION}-*<br>mirror.anl.gov|http://mirror.anl.gov/pub/ubuntu|Packages-ubuntu-${DISTRO_COMPAT_VERSION}-*<br>mirrors.kernel.org|http://mirrors.kernel.org/ubuntu|Packages-ubuntu-${DISTRO_COMPAT_VERSION}-*<br>archive.ubuntu.com|http://archive.ubuntu.com/ubuntu|Packages-ubuntu-${DISTRO_COMPAT_VERSION}-*</pre>
There are actually three different repositories on each site that Puppy
can download from, 'main', 'universe' and 'multiverse'. Puppy has a
database file for each, for example for the 'Intrepid' release of
Ubuntu: 'Packages-ubuntu-intrepid-main',
'Packages-ubuntu-intrepid-universe' and
'Packages-ubuntu-intrepid-multiverse'. Accordingly, the
PKG_DOCS_DISTRO_COMPAT variable has this:<br>
<pre>archive.ubuntu.com|http://archive.ubuntu.com/ubuntu/dists/intrepid/main/binary-i386/Packages.bz2|Packages-ubuntu-${DISTRO_COMPAT_VERSION}-main <br>archive.ubuntu.com|http://archive.ubuntu.com/ubuntu/dists/intrepid/universe/binary-i386/Packages.bz2|Packages-ubuntu-${DISTRO_COMPAT_VERSION}-universe <br>archive.ubuntu.com|http://archive.ubuntu.com/ubuntu/dists/intrepid/multiverse/binary-i386/Packages.bz2|Packages-ubuntu-${DISTRO_COMPAT_VERSION}-multiverse</pre>
...that is, it specifies all three databases.<br>
<h2>DISTRO_PET_REPOS</h2>
Adding another repository of .pet packages is probably the most likely
requirement of a Puppy user. Chances are, when you upgrade to the
latest version of Puppy the package manager will be accessing the most
appropriate repositories. But, you might want to make an addition right
now, or especially so if you are a Puppy-developer.<br>
<h3>PKG_DOCS_PET_REPOS</h3>
It is really the same as described above. File DISTRO_PET_REPOS has
variable PKG_DOCS_PET_REPOS and here is it's current contents:<br>
<pre>ibiblio.org|http://distro.ibiblio.org//puppylinux/Packages-puppy-woof-official|Packages-puppy-woof-official <br>ibiblio.org|http://distro.ibiblio.org//puppylinux/Packages-puppy-4-official|Packages-puppy-4-official <br>ibiblio.org|http://distro.ibiblio.org//puppylinux/Packages-puppy-3-official|Packages-puppy-3-official <br>ibiblio.org|http://distro.ibiblio.org//puppylinux/Packages-puppy-2-official|Packages-puppy-2-official</pre>
Note that the database filename on the site is the same as that after
it is downloaded. This is because the PET database file on the site is
supposed to already be in the "standardised format". Puppy from version
2.0 up to and including version 4.x has kept package database
information in a file /root/.packages/packages.txt, but this is
different from the new standardised format -- note though, the Woof
build system has a script for converting old 'packages.txt' files into
the new format.<br>
<br>
So, say you have a repository of .pet packages. Let's say&nbsp;
at&nbsp; http://johhny.org/petrepo. What you will have to do is create
a database file, say 'Packages-puppy-4-johhny' -- the naming convention
is that the second field 'puppy' identifies this as a Puppy .pet repo,
the third field '4' identifies what version of Puppy these packages are
compiled on/for, while the last field is a unique identification of the
repository.<br>
<br>
So, add an entry to variable PKG_DOCS_PET_REPOS:<br>
<pre>johhny.org|http://johhny.org/petrepo|Packages-puppy-4-johhny</pre>
<h3>PET_REPOS</h3>
This is another variable in file DISTRO_PET_REPOS. Here are the current contents:<br>
<pre>ibiblio.org|http://distro.ibiblio.org//puppylinux|Packages-puppy-*-official <br>ftp.nluug.nl|http://ftp.nluug.nl/ftp/pub/os/Linux/distr/puppylinux|Packages-puppy-*-official <br>ftp.linux.hr|ftp://ftp.linux.hr/puppylinux|Packages-puppy-*-official <br>ftp.vcu.edu|ftp://ftp.vcu.edu/pub/gnu+linux/puppylinux|Packages-puppy-*-official <br>ftp.tu-chemnitz.de|ftp://ftp.tu-chemnitz.de/.SAN0/pub/linux/sunsite.unc-mirror/distributions/puppylinux|Packages-puppy-*-official <br>ftp.ussg.iu.edu|ftp://ftp.ussg.iu.edu/linux/puppylinux|Packages-puppy-*-official <br>ftp.lug.udel.edu|ftp://ftp.lug.udel.edu/pub/puppylinux|Packages-puppy-*-official <br>ftp.sh.cvut.cz|ftp://ftp.sh.cvut.cz/storage/1/puppy|Packages-puppy-*-official</pre>
...notice the '*' wildcard. This is because all of the pet package repositories are at the same sites.<br>
<br>
For our hypothetical example, add this line:<br>
<pre>johhny.org|http://johhny.org/petrepo|Packages-puppy-4-johhny</pre>

...note again, the .pet packages may be in subdirectories below 'petrepo' and this is defined in the database file.<br>
<br>
What the above line is saying is that for any of the packages dclared
in 'Packages-puppy-4-johhny', you will find them at
http://johhny.org/petrepo.<br>
<h2>Summary</h2>
If you add the two entries as shown in the above example, and create a
database file 'Packages-puppy-4-johhny' at the website, that's it,
you're ready to go.<br>
<br>
Click the 'Configure package manager' button in the main GUI window,
then click 'Update now', the package manager will download the
'Packages-puppy-4-johhny' and add it to the others and the packages
will then display in the main GUI window.<br>
<br>
On the other hand, if you want to remove any repository, remove the
entries in the variables (the reverse of that above procedure) and
delete the 'Packages-*' file.<br>
<br>
A final point about the example package database file
'Packages-puppy-4-johhny'. A repository could have mixed .pet packages,
that have been compiled in different versions of Puppy. In such a
situation, you could create separate 'Packages-*' files for each group.
Alternatively, the package database does have extra fields for each
package entry that can declare what environment the package was
compiled in, for example 'ubuntu|intrepid|puppy' means that this
package was compiled in a Puppy that was built from Ubuntu Intrepid
packages. I have such a mixed bunch of packages at my ibiblio site, in
directory 'pet_packages-woof', and the package database file is
'Packages-puppy-woof-official' -- the 'woof' field is not one of the
Puppy release numbers. The Puppy Package Manager is able to sift
through such a mixed database and offer only the appropriate packages
for installation.<br>
<br>
Regards,<br>
Barry Kauler<br>October 2009<br>
<br>

  </div> <!--main-->
</div>
</body></html>